import { Route, Routes } from "react-router-dom";
import HomePageMenu from "./menu/HomePageMenu";
import UserStudy from "./study/UserStudy";
import TrainProblem from "./study/train/problem/TrainProblem";
import AuthTrain from "src/common/config/AuthTrain";
import AdminHomePage from "src/admin/AdminHomePage";
import AuthAdmin from "src/common/config/AuthAdmin";
import UserCommunity from "./community/UserCommunity";
import UserExplore from "./explore/UserExplore";
import StudyExam from "./study/exam/StudyExam";

const UserHomePage = () => {
  
    return (
      <>
        <HomePageMenu />
        <Routes>
          <Route path="/study/exam" element={<StudyExam />} />
          <Route
            path="/*"
            element={
              <AuthTrain>
                <UserStudy />
              </AuthTrain>
            }
          />
          <Route
            path="/study"
            element={
              <AuthTrain>
                <UserStudy />
              </AuthTrain>
            }
          />
          <Route path="/community" element={<UserCommunity />} />
          <Route path="/explore" element={<UserExplore />} />
          <Route path="/study/train/problem" element={<TrainProblem />} />

          <Route
            path="/admin"
            element={
              <AuthAdmin>
                <AdminHomePage />
              </AuthAdmin>
            }
          />
          <Route
            path="/test"
            element={
              <AuthAdmin>
                <AdminHomePage />
              </AuthAdmin>
            }
          />
        </Routes>
      </>
    );
  };

  export default UserHomePage;